local yeming = fk.CreateSkill{
  name = "th_yeming",
}

yeming:addEffect(fk.BeforeDrawCard, {
  anim_type = "drawcard",
  on_use = function(self, event, target, player, data)
    data.num = data.num + 1
    if player.phase == Player.Play and not player:isNude() then
      player.room:askToDiscard(player, {
        min_num = 1,
        max_num = 1,
        include_equip = true,
        skill_name = yeming.name,
        cancelable = false,
        prompt = '#th_yeming-discard'
      })
    end
  end
})

yeming:addTest(function (room, me)
  FkTest.RunAddSkills(me, yeming.name)

  FkTest.setNextReplies(me, {
    "1"
  })

  --- test1: 摸两张牌
  --- 期望:  摸三张牌
  FkTest.runInRoom(function ()
    room:moveCardTo(1, Card.DrawPile) -- 控顶，为test2做准备
    me:drawCards(2)
  end)
  lu.assertEquals(me:getHandcardNum(), 3)
end)

Fk:loadTranslationTable{
  ["th_yeming"] = "夜鸣",
  [":th_yeming"] = "当你摸牌时，你可以多摸一张牌，若为你的出牌阶段，你须弃置一张牌。",

  ["#th_yeming-discard"] = "夜鸣：你须弃置一张牌",
}

return yeming
